package com.hemaapp.yjnh.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import xtom.frame.XtomObject;
import xtom.frame.exception.DataParseException;

/**家族信息
 * @author GuiyouZhang
 * Date：2015年10月12日 上午10:18:12
 * Email:guiyouzhang@163.com
 */
public class Family extends XtomObject implements Serializable {

	private static final long serialVersionUID = 1L;

	private String client_id;// 用户id
    private String nickname;// 昵称
	private String avatar;// 头像
	private String score;// 星数
	private int rank;//排名

	public Family(JSONObject jsonObject) throws DataParseException {
		if (jsonObject != null) {
			try {
				client_id = get(jsonObject, "client_id");
				nickname = get(jsonObject, "nickname");
				avatar = get(jsonObject, "avatar");
				score = get(jsonObject, "score");

				log_i(toString());
			} catch (JSONException e) {
				throw new DataParseException(e);
			}
		}
	}

	@Override
	public String toString() {
		return "Cash [client_id=" + client_id + ", avatar="
				+ avatar + ", nickname=" + nickname + ", score=" + score +"]";
	}

	/**
	 * @return the client_id
	 */
	public String getClient_id() {
		return client_id;
	}

    /**
     * @return the nickname
     */
    public String getnickname() {
        return nickname;
    }

	/**
	 * @return the avatar
	 */
	public String getAvatar() {
		return avatar;
	}

	/**
	 * @return the score
	 */
	public String getscore() {
		return score;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}
	
	public int getRank() {
		return rank;
	}
}
